@echo off

REM 构建MCP服务器
echo Building MCP Server...
go build -o drcom-mcp-server.exe main_mcp_server.go

if %errorlevel% equ 0 (
    echo ✅ Build successful! Executable: drcom-mcp-server.exe
    
    REM 创建简化的mcp.json for executable
    echo {> mcp_executable.json
    echo   "mcpVersion": "2024-11-05",>> mcp_executable.json
    echo   "name": "drcom-server",>> mcp_executable.json
    echo   "version": "1.0.0",>> mcp_executable.json
    echo   "description": "Drcom业务系统查询工具，支持用户使用量和联系信息查询",>> mcp_executable.json
    echo   "server": {>> mcp_executable.json
    echo     "command": "./drcom-mcp-server.exe">> mcp_executable.json
    echo   }>> mcp_executable.json
    echo }>> mcp_executable.json
    
    echo ✅ Created mcp_executable.json for binary execution
) else (
    echo ❌ Build failed
    exit /b 1
) 